package com.iukcy.hight.model;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.iukcy.hight.convert.CustomStringStringConverter;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author zhangzhufu
 * @since 2020-09-19
 */
@Data
@EqualsAndHashCode
@Accessors
@TableName("t_class")
@HeadRowHeight(20)
@ContentRowHeight(25)
@ColumnWidth(25)
public class TClass extends Model<TClass> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @ExcelIgnore
    private Integer id;
    @ExcelProperty(value = {"课程报名人数表", "课程名称"}, index = 0)
    private String className;
    @ExcelProperty(value = {"课程报名人数表", "报名人数"}, index = 1)
    private Integer num;
    @ExcelProperty(value = {"课程报名人数表", "备注"}, index = 2, converter = CustomStringStringConverter.class)
    private String remark;
    @DateTimeFormat("yyyy年MM月dd日HH时mm分ss秒")
    @ExcelProperty(value = {"课程报名人数表", "开始时间"}, index = 3)
    private Date createTime;
    @NumberFormat("#.##")
    @ExcelProperty(value = {"课程报名人数表", "报名费"}, index = 4)
    private Double money;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
